﻿package mortal.game.view.guildNew.WareHourse
{
    import Message.Game.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.common.tools.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.item.*;

    public class GuildNewWareHCell3 extends GCellRenderer
    {
        protected var _line:ScaleBitmap;
        protected var _adnot:GTextFiled;
        protected var _nameT:GTextFiled;
        protected var _time:GTextFiled;
        protected var _item:NumLevelBaseItem;

        public function GuildNewWareHCell3()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._line = UIFactory.bg(-6, 48, 320, 1, this, ImagesConst.SplitLine);
            this._adnot = UIFactory.gTextField("" + Language.getString(71630), 15, 14, 100, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).setSize(13));
            this._nameT = UIFactory.gTextField("", 55, 16, 100, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).center());
            this._time = UIFactory.gTextField("06-16 23:59", 163, 16, 100, 20, this, GlobalStyle.textFormatLv);
            this._item = UIFactory.getUICompoment(NumLevelBaseItem);
            this._item.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
            UIFactory.setObjAttri(this._item, 248, 3, -1, -1, this);
            var _loc_1:Boolean = false;
            this._item.isDropAble = false;
            this._item.isDragAble = _loc_1;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            var _loc_2:Boolean = false;
            this._item.isShowColorBg = false;
            this._line = null;
            this._adnot = null;
            this._nameT = null;
            this._time = null;
            this._item = null;
            super.disposeImpl(param1);
            return;
        }// end function

        override public function get data() : Object
        {
            return super.data;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:SGuildWarehouseRecord = null;
            var _loc_3:ItemData = null;
            super.data = param1;
            if (param1 == null)
            {
                return;
            }
            if (param1 is SGuildWarehouseRecord)
            {
                _loc_2 = param1 as SGuildWarehouseRecord;
                if (_loc_2.itemCode == 0)
                {
                    _loc_3 = new ItemData(_loc_2.unit);
                }
                else
                {
                    _loc_3 = new ItemData(_loc_2.itemCode);
                }
                _loc_3.itemAmount = _loc_2.amount;
                this._item.itemData = _loc_3;
                this._nameT.text = _loc_2.startName;
                this._time.text = DateParser.parse(_loc_2.operDt, "MM-dd hh:mm");
                this._adnot.text = GuildConst.getWareHouseOperTypeName(_loc_2.oper);
            }
            return;
        }// end function

    }
}
